package com.lc.luzhengtang.adapter;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lc.luzhengtang.R;
import com.lc.luzhengtang.bean.CommentList;
import com.zcx.helper.scale.ScaleScreenHelperFactory;

import java.util.List;

/**
 * https://github.com/CymChad/BaseRecyclerViewAdapterHelper
 */
public class SectionAdapter2 extends BaseQuickAdapter<CommentList.DataBeanXX.DataBeanX, BaseViewHolder> {

    RecyclerView recyclerView;
    SectionItemAdapter2 sectionItemAdapter;
    List<CommentList.DataBeanXX.DataBeanX> dataBeen;


    public SectionAdapter2(List<CommentList.DataBeanXX.DataBeanX> data) {
        super(R.layout.item_comment2, data);
        this.dataBeen = data;
    }

    @Override
    protected void convert(BaseViewHolder helper, CommentList.DataBeanXX.DataBeanX item) {
        ScaleScreenHelperFactory.getInstance().loadView((ViewGroup) helper.convertView);
        recyclerView = helper.getView(R.id.recycle_personal_list);
        recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        sectionItemAdapter = new SectionItemAdapter2(item.getIndex().getData());

        if (item != null) {
            recyclerView.setAdapter(sectionItemAdapter);
        }

        helper.addOnClickListener(R.id.text_order_detail);
        View view = helper.getConvertView();
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                CommentListActivity
//                mContext.startActivity(new Intent(mContext, CommentListActivity2.class));
            }
        });
    }


}
